/*
 *  Copyright 2010 UPF Telecos 4th group G.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package edu.upf.database.impl;

import edu.upf.database.DBActionResult;
import java.util.List;

/**
 * Implementation of a database action result
 * @author netjois
 */
public class DBActionResultImpl implements DBActionResult {
    
    private boolean isOk;
    private String errorMsg;
    private Throwable exception;
    private List result;

    @Override
    public boolean isOk() {
        return isOk;
    }

    @Override
    public String getErrorMsg() {
        return errorMsg;
    }

    @Override
    public Throwable getException() {
        return exception;
    }

    @Override
    public List getResult() {
        return result;
    }

    @Override
    public void setErrorMsg(String anErrorMsg) {
        errorMsg=anErrorMsg;
        isOk=false;
    }

    @Override
    public void setException(Throwable anException) {
        exception=anException;
        isOk=false;
    }

    @Override
    public void setResult(List aResult) {
        result=aResult;
        isOk=true;
    }
}
